package com.log4j.kafka;

import com.log4j.kafka.utils.RecordLog;
import org.apache.kafka.log4jappender.KafkaLog4jAppender;
import org.apache.log4j.Logger;

/**
 * Created by yangshunxing on 2017/5/9.
 */
public class Log4jToKafka {

    public static void main(String[] args) {
        for (int i =0 ; i<10; i++){
           /* KafkaLog4jAppender appender = new KafkaLog4jAppender();
            appender.setTopic("kafkaTest");
            appender.setBrokerList("192.168.0.244:9092");
            logger.addAppender(appender);*/
//            logger.info("log4jToKafka test");
//            logger.warn("warn test");
            RecordLog.recordLog("record test");
            try {
                Thread.sleep(501);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
